/**************************************************************************
Step 1. Include necessary header files such that the stuff your test logic needs is declared. 
Don't forget gtest.h, which declares the testing framework.                                                   
**************************************************************************/
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

#include "gtest/gtest.h"
#include "include/pf_ini.h"


/**************************************************************************
Step 2. Use test fixture to design your complex cases. 
You can add SetUp() to initialize the test data and 
TearDown() to clear the test data for common usage
Pls remember that when you using test fixture, need to use macro "TEST_F" instead of "TEST"                                                 
**************************************************************************/
class PfIniTest : public testing::Test 
{
    /* This SetUp() will be called before every TEST CASE which is marked by macro "TEST_F" */
    virtual void SetUp() 
    {
        int fd = -1;
        ssize_t wr_size = 0;
        ssize_t data_len = 0;
        const char* ini_data =  
            "; Global key-values first;\n"
            "global_key1 = global_val1_weyrowerwe223xwerwwerxwerwewerwexewe\n"
            "global_key2 = a(global_val2)f\n"
            "# This will be passed to all mysql clients\n"
            "[client]\n"
            "port        = 13306  \n"
            "  socket    = /home/lijz/opt/mysql-5.1.51/var/run/mysqld/mysqld.sock \n"
            "#max_allowed_packet = 256M\n"
            " #default-character-set = utf8\n"
            "\r\n"
            "[mysqld_safe]\r\n"
            "socket      = /home/lijz/opt/mysql-5.1.51/var/run/mysqld/mysqld.sock\r\n"
            "nice        = 0\r\n"
            "\n"
            "[mysqld]\n"
            " ;# * Basic Settings\n"
            "user        = lijz\n"
            "socket      = /home/lijz/opt/mysql-5.1.51/var/run/mysqld/mysqld.sock\n"
            "port=3306\n"
            "basedir = /home/lijz/opt/mysql-5.1.51\n"
            ";bind-address       = 127.0.0.1\n"
            "bind-address=0.0.0.0\n"
            "\n"
            "[client]\n"
            "port        = $(mysqld:port)  \n"
            "socket = $(mysqld:socket) \n"
            "sockets = prefix1_$(mysqld:socket)_$(mysqld:socket)_posix1 \n"
            "sockets = prefix2_$(mysqld:socket)_posix2 \n"
            "g_ref_var1 = $(global_key1)\n"
            "g_ref_var2 = ayoubywerwer_$(global_key2) 123034\n"
            "duplicate_k=1 234\n"
            "duplicate_k=2\n"
            "duplicate_k=3\n"
            "duplicate_k=4\n"
            "duplicate_k=5\n"
            "duplicate_k=6\n"
            "duplicate_k=7\n"
            "duplicate_k=8\n"
            "duplicate_k=9\n"
            "duplicate_k=10\n"
            "\r\n"
            "#exception section for test\n"
            "[except section]\n"
            "sp value = \r\n"
            "var ref1=$$(except section:sp value)_posix\n"
            "not_var_ref_1=$(client$=\n"
            "not_var_ref_2=$weab=)w0r\n"
            "\n"
            "; Global key-values;\n"
            ";[comment section] \n"
            "no_comment_key = #ayouere103r;\n"
            "\n"
            "[recursive1]\n"
            "k1=k1_$(recursive1:k2)\n"
            "k2=k2_$(recursive1:k3)\n"
            "k3=v3_wyozms3224$wwerwre)\n"
            "\n"
            "[recursive2]\n"
            "k1=k2\n"
            "k2=v2_weyoucyowerweryouwerwerweyowyrwe\n"
            "k3=k3_$(recursive2:$(recursive2:k1)))_k3\n"
            "\r\n"
            "[recursive3]\n"
            "k1=$(recursive3:k2)\n"
            "k2=$(recursive3:k3)$(recursive3:k4)\n"
            "k3=$(recursive3:k\n"
            "k4=5)\n"
            "k5=k5_value5_youwerweryouweryouwernwerywouwerwewer";

        const char* except_ini_data_1 =
            "[except section]\n"
            "except_key = $(unknown_section:unknown_key)abc)de\n"
            "except_key = $(unknown_section:unknown_key2)";
        const char* except_ini_data_2 =
            "[long_section]\n"
            "k1=youwerweyroweurxxosdfyworwyerweoruweorywerowerwemrweryweoruwerwerwewerwerlwerwesfwerwerwer23423"
            "weryweoruwerwerweyrwoeruwerwenrweyroweurwernweryweoruewrwenrweyroweurwerweyrweorwerewrwerwerwerwer"
            "weryweoruwerwerweyrwoeruwerwenrweyroweurwernweryweoruewrwenrweyroweurwerweyrweorwerewrwerwerwerwer"
            "weryweoruwerwerweyrwoeruwerwenrweyroweurwernweryweoruewrwenrweyroweurwerweyrweorwerewrwerwerwerwer"
            "weryweoruwerwerweyrwoeruwerwenrweyroweurwernweryweoruewrwenrweyroweurwerweyrweorwerewrwerwerwerwer"
            "weryweoruwerwerweyrwoeruwerwenrweyroweurwernweryweoruewrwenrweyroweurwerweyrweorwerewrwerwerwerwer"
            "weryweoruwerwerweyrwoeruwerwenrweyroweurwernweryweoruewrwenrweyroweurwerweyrweorwerewrwerwerwerwer"
            "weryweoruwerwerweyrwoeruwerwenrweyroweurwernweryweoruewrwenrweyroweurwerweyrweorwerewrwerwerwerwer"
            "weryweoruwerwerweyrwoeruwerwenrweyroweurwernweryweoruewrwenrweyroweurwerweyrweorwerewrwerwerwerwer"
            "weryweoruwerwerweyrwoeruwerwenrweyroweurwernweryweoruewrwenrweyroweurwerweyrweorwerewrwerwerwerwer"
            "weryweoruwerwerweyrwoeruwerwenrweyroweurwernweryweoruewrwenrweyroweurwerweyrweorwerewrwerwerwerwer"
            "weryweoruwerwerweyrwoeruwerwenrweyroweurwernweryweoruewrwenrweyroweurwerweyrweorwerewrwerwerwerwer"
            "weryweoruwerwerweyrwoeruwerwenrweyroweurwernweryweoruewrwenrweyroweurwerweyrweorwerewrwerwerwerwer"
            "weryweoruwerwerweyrwoeruwerwenrweyroweurwernweryweoruewrwenrweyroweurwerweyrweorwerewrwerwerwerwer"
            "weryweoruwerwerweyrwoeruwerwenrweyroweurwernweryweoruewrwenrweyroweurwerweyrweorwerewrwerwerwerwer\n"
            "k2=p_$(long_section:k1)_$(long_section:k1)_$(long_section:k1)_$(long_section:k1)_$(long_section:k1)"
            "_$(long_section:k1)_$(long_section:k1)_$(long_section:k1)_$(long_section:k1)_$(long_section:k1)"
            "_$(long_section:k1)_$(long_section:k1)_$(long_section:k1)_$(long_section:k1)_$(long_section:k1)";
        const char* except_ini_data_3 =
            "; recursive\n"
            "k1 = k1_$(k2)_k1\n"
            "k2 = k2_$(k1)_k2";
        const char* except_ini_data_4 =
            "self_k1=$(self_k1)\n";
            
        /* init normal ini file */
        ini_file = "/tmp/test_pf_ini.ini";

        fd = open(ini_file, O_WRONLY|O_CREAT|O_TRUNC, 0644);
        ASSERT_NE(-1, fd);

        data_len = strlen(ini_data);
        wr_size = write(fd, ini_data, data_len);
        ASSERT_EQ(data_len, wr_size);

        close(fd);

        /* init expection ini file1 */
        except_ini_file_1 = "/tmp/test_except_pf_ini_1.ini";

        fd = open(except_ini_file_1, O_WRONLY|O_CREAT|O_TRUNC, 0644);
        ASSERT_NE(-1, fd);

        data_len = strlen(except_ini_data_1);
        wr_size = write(fd, except_ini_data_1, data_len);
        ASSERT_EQ(data_len, wr_size);

        close(fd);

        /* init expection ini file2 */
        except_ini_file_2 = "/tmp/test_except_pf_ini_2.ini";

        fd = open(except_ini_file_2, O_WRONLY|O_CREAT|O_TRUNC, 0644);
        ASSERT_NE(-1, fd);

        data_len = strlen(except_ini_data_2);
        wr_size = write(fd, except_ini_data_2, data_len);
        ASSERT_EQ(data_len, wr_size);

        close(fd);

        /* init expection ini file3 */
        except_ini_file_3 = "/tmp/test_except_pf_ini_3.ini";

        fd = open(except_ini_file_3, O_WRONLY|O_CREAT|O_TRUNC, 0644);
        ASSERT_NE(-1, fd);

        data_len = strlen(except_ini_data_3);
        wr_size = write(fd, except_ini_data_3, data_len);
        ASSERT_EQ(data_len, wr_size);

        close(fd);

        /* init expection ini file4 */
        except_ini_file_4 = "/tmp/test_except_pf_ini_4.ini";

        fd = open(except_ini_file_4, O_WRONLY|O_CREAT|O_TRUNC, 0644);
        ASSERT_NE(-1, fd);

        data_len = strlen(except_ini_data_4);
        wr_size = write(fd, except_ini_data_4, data_len);
        ASSERT_EQ(data_len, wr_size);

        close(fd);
    }

    /* This TearDown will be called after every TEST CASE which is marked by macro "TEST_F" */
    virtual void TearDown() 
    {
        unlink(ini_file);
        unlink(except_ini_file_1);
        unlink(except_ini_file_2);
        unlink(except_ini_file_3);
        unlink(except_ini_file_4);
    }

public:
    const char* ini_file;
    const char* except_ini_file_1;
    const char* except_ini_file_2;
    const char* except_ini_file_3;
    const char* except_ini_file_4;
};

/***************************************************************************
Step 3. Use macro "TEST_F" to start your test case                                      
You can design your test case as the example
***************************************************************************/
TEST_F(PfIniTest, IniTest)
{
    /* Define the local variables */
    int ret = -1;
    const char* ret_ptr = NULL;
    int32_t count = 0;
    pf_ini_t* ini_t = NULL;

    /* initilize test data for this case */
    ini_t = pf_ini_load(ini_file);
    EXPECT_NE((void*)NULL, ini_t);

    /* Call your function for test */
    /* Check the result */
    ret_ptr = pf_ini_find(ini_t, "", "global_key1", 0);
    EXPECT_NE((void*)NULL, ret_ptr);
    EXPECT_STREQ("global_val1_weyrowerwe223xwerwwerxwerwewerwexewe", ret_ptr);

    ret_ptr = pf_ini_find(ini_t, "", "global_key2", 0);
    EXPECT_NE((void*)NULL, ret_ptr);
    EXPECT_STREQ("a(global_val2)f", ret_ptr);

    count = pf_ini_count(ini_t, "", "global_key1");
    EXPECT_EQ(1, count);

    ret_ptr = pf_ini_find(ini_t, "", "global_key1", 3);
    EXPECT_EQ((void*)NULL, ret_ptr);

    ret_ptr = pf_ini_find(ini_t, "", "unkown_global_key", 0);
    EXPECT_EQ((void*)NULL, ret_ptr);

    ret_ptr = pf_ini_find(ini_t, "client", "port", 0);
    EXPECT_NE((void*)NULL, ret_ptr);
    EXPECT_STREQ("13306", ret_ptr);

    ret_ptr = pf_ini_find(ini_t, "client", "socket", 0);
    EXPECT_NE((void*)NULL, ret_ptr);
    EXPECT_STREQ("/home/lijz/opt/mysql-5.1.51/var/run/mysqld/mysqld.sock", ret_ptr);

    ret_ptr = pf_ini_find(ini_t, "client", "max_allowed_packet", 0);
    EXPECT_EQ((void *)NULL, ret_ptr);

    ret_ptr = pf_ini_find(ini_t, "client", "default-character-set", 0);
    EXPECT_EQ((void *)NULL, ret_ptr);

    ret_ptr = pf_ini_find(ini_t, "mysqld_safe", "socket", 0);
    EXPECT_NE((void*)NULL, ret_ptr);
    EXPECT_STREQ("/home/lijz/opt/mysql-5.1.51/var/run/mysqld/mysqld.sock", ret_ptr);

    ret_ptr = pf_ini_find(ini_t, "mysqld_safe", "nice", 0);
    EXPECT_NE((void*)NULL, ret_ptr);
    EXPECT_STREQ("0", ret_ptr);

    ret_ptr = pf_ini_find(ini_t, "mysqld", "user", 0);
    EXPECT_NE((void*)NULL, ret_ptr);
    EXPECT_STREQ("lijz", ret_ptr);

    ret_ptr = pf_ini_find(ini_t, "mysqld", "socket", 0);
    EXPECT_NE((void*)NULL, ret_ptr);
    EXPECT_STREQ("/home/lijz/opt/mysql-5.1.51/var/run/mysqld/mysqld.sock", ret_ptr);

    ret_ptr = pf_ini_find(ini_t, "mysqld", "port", 0);
    EXPECT_NE((void*)NULL, ret_ptr);
    EXPECT_STREQ("3306", ret_ptr);

    ret_ptr = pf_ini_find(ini_t, "mysqld", "basedir", 0);
    EXPECT_NE((void*)NULL, ret_ptr);
    EXPECT_STREQ("/home/lijz/opt/mysql-5.1.51", ret_ptr);
    
    ret_ptr = pf_ini_find(ini_t, "mysqld", "bind-address", 0);
    EXPECT_NE((void*)NULL, ret_ptr);
    EXPECT_STREQ("0.0.0.0", ret_ptr);

    ret_ptr = pf_ini_find(ini_t, "client", "port", 1);
    EXPECT_NE((void*)NULL, ret_ptr);
    EXPECT_STREQ("3306", ret_ptr);

    ret_ptr = pf_ini_find(ini_t, "client", "socket", 1);
    EXPECT_NE((void*)NULL, ret_ptr);
    EXPECT_STREQ("/home/lijz/opt/mysql-5.1.51/var/run/mysqld/mysqld.sock", ret_ptr);

    ret_ptr = pf_ini_find(ini_t, "client", "sockets", 0);
    EXPECT_NE((void*)NULL, ret_ptr);
    EXPECT_STREQ("prefix1_/home/lijz/opt/mysql-5.1.51/var/run/mysqld/mysqld.sock_"
                 "/home/lijz/opt/mysql-5.1.51/var/run/mysqld/mysqld.sock_posix1", ret_ptr);
    
    ret_ptr = pf_ini_find(ini_t, "client", "sockets", 1);
    EXPECT_NE((void*)NULL, ret_ptr);
    EXPECT_STREQ("prefix2_/home/lijz/opt/mysql-5.1.51/var/run/mysqld/mysqld.sock_posix2", ret_ptr);

    ret_ptr = pf_ini_find(ini_t, "client", "g_ref_var1", 0);
    EXPECT_NE((void*)NULL, ret_ptr);
    EXPECT_STREQ("global_val1_weyrowerwe223xwerwwerxwerwewerwexewe", ret_ptr);

    ret_ptr = pf_ini_find(ini_t, "client", "g_ref_var2", 0);
    EXPECT_NE((void*)NULL, ret_ptr);
    EXPECT_STREQ("ayoubywerwer_a(global_val2)f 123034", ret_ptr);

    count = pf_ini_count(ini_t, "client", "duplicate_k");
    EXPECT_EQ(10, count);

    ret_ptr = pf_ini_find(ini_t, "client", "duplicate_k", 0);
    EXPECT_NE((void*)NULL, ret_ptr);
    EXPECT_STREQ("1 234", ret_ptr);

    ret_ptr = pf_ini_find(ini_t, "client", "duplicate_k", 1);
    EXPECT_NE((void*)NULL, ret_ptr);
    EXPECT_STREQ("2", ret_ptr);

    ret_ptr = pf_ini_find(ini_t, "client", "duplicate_k", 2);
    EXPECT_NE((void*)NULL, ret_ptr);
    EXPECT_STREQ("3", ret_ptr);

    ret_ptr = pf_ini_find(ini_t, "client", "duplicate_k", 3);
    EXPECT_NE((void*)NULL, ret_ptr);
    EXPECT_STREQ("4", ret_ptr);

    ret_ptr = pf_ini_find(ini_t, "client", "duplicate_k", 4);
    EXPECT_NE((void*)NULL, ret_ptr);
    EXPECT_STREQ("5", ret_ptr);

    ret_ptr = pf_ini_find(ini_t, "client", "duplicate_k", 5);
    EXPECT_NE((void*)NULL, ret_ptr);
    EXPECT_STREQ("6", ret_ptr);

    ret_ptr = pf_ini_find(ini_t, "client", "duplicate_k", 6);
    EXPECT_NE((void*)NULL, ret_ptr);
    EXPECT_STREQ("7", ret_ptr);

    ret_ptr = pf_ini_find(ini_t, "client", "duplicate_k", 7);
    EXPECT_NE((void*)NULL, ret_ptr);
    EXPECT_STREQ("8", ret_ptr);

    ret_ptr = pf_ini_find(ini_t, "client", "duplicate_k", 8);
    EXPECT_NE((void*)NULL, ret_ptr);
    EXPECT_STREQ("9", ret_ptr);

    ret_ptr = pf_ini_find(ini_t, "client", "duplicate_k", 9);
    EXPECT_NE((void*)NULL, ret_ptr);
    EXPECT_STREQ("10", ret_ptr);

    ret_ptr = pf_ini_find(ini_t, "client", "duplicate_k", 10);
    EXPECT_EQ((void*)NULL, ret_ptr);

    ret_ptr = pf_ini_find(ini_t, "except section", "sp value", 0);
    EXPECT_NE((void*)NULL, ret_ptr);
    EXPECT_STREQ("", ret_ptr);

    ret_ptr = pf_ini_find(ini_t, "except section", "var ref1", 0);
    EXPECT_NE((void*)NULL, ret_ptr);
    EXPECT_STREQ("$_posix", ret_ptr);

    ret_ptr = pf_ini_find(ini_t, "except section", "not_var_ref_1", 0);
    EXPECT_NE((void*)NULL, ret_ptr);
    EXPECT_STREQ("$(client$=", ret_ptr);

    ret_ptr = pf_ini_find(ini_t, "except section", "not_var_ref_2", 0);
    EXPECT_NE((void*)NULL, ret_ptr);
    EXPECT_STREQ("$weab=)w0r", ret_ptr);

    ret_ptr = pf_ini_find(ini_t, "comment section", "no_comment_key", 0);
    EXPECT_EQ((void*)NULL, ret_ptr);

    ret_ptr = pf_ini_find(ini_t, "except section", "no_comment_key", 0);
    EXPECT_NE((void*)NULL, ret_ptr);
    EXPECT_STREQ("#ayouere103r;", ret_ptr);

    ret_ptr = pf_ini_find(ini_t, "recursive1", "k1", 0);
    EXPECT_NE((void*)NULL, ret_ptr);
    EXPECT_STREQ("k1_k2_v3_wyozms3224$wwerwre)", ret_ptr);

    ret_ptr = pf_ini_find(ini_t, "recursive1", "k2", 0);
    EXPECT_NE((void*)NULL, ret_ptr);
    EXPECT_STREQ("k2_v3_wyozms3224$wwerwre)", ret_ptr);

    ret_ptr = pf_ini_find(ini_t, "recursive1", "k3", 0);
    EXPECT_NE((void*)NULL, ret_ptr);
    EXPECT_STREQ("v3_wyozms3224$wwerwre)", ret_ptr);

    ret_ptr = pf_ini_find(ini_t, "recursive2", "k1", 0);
    EXPECT_NE((void*)NULL, ret_ptr);
    EXPECT_STREQ("k2", ret_ptr);

    ret_ptr = pf_ini_find(ini_t, "recursive2", "k2", 0);
    EXPECT_NE((void*)NULL, ret_ptr);
    EXPECT_STREQ("v2_weyoucyowerweryouwerwerweyowyrwe", ret_ptr); 

    ret_ptr = pf_ini_find(ini_t, "recursive2", "k3", 0);
    EXPECT_NE((void*)NULL, ret_ptr);
    EXPECT_STREQ("k3_v2_weyoucyowerweryouwerwerweyowyrwe)_k3", ret_ptr);

    ret_ptr = pf_ini_find(ini_t, "recursive3", "k1", 0);
    EXPECT_NE((void*)NULL, ret_ptr);
    EXPECT_STREQ("k5_value5_youwerweryouweryouwernwerywouwerwewer", ret_ptr);

    ret_ptr = pf_ini_find(ini_t, "recursive3", "k2", 0);
    EXPECT_NE((void*)NULL, ret_ptr);
    EXPECT_STREQ("k5_value5_youwerweryouweryouwernwerywouwerwewer", ret_ptr);

    ret_ptr = pf_ini_find(ini_t, "recursive3", "k3", 0);
    EXPECT_NE((void*)NULL, ret_ptr);
    EXPECT_STREQ("$(recursive3:k", ret_ptr);

    ret_ptr = pf_ini_find(ini_t, "recursive3", "k4", 0);
    EXPECT_NE((void*)NULL, ret_ptr);
    EXPECT_STREQ("5)", ret_ptr);

    ret_ptr = pf_ini_find(ini_t, "recursive3", "k5", 0);
    EXPECT_NE((void*)NULL, ret_ptr);
    EXPECT_STREQ("k5_value5_youwerweryouweryouwernwerywouwerwewer", ret_ptr);

    count = pf_ini_count(ini_t, "client", "port");
    EXPECT_EQ(2, count);

    ret_ptr = pf_ini_find(ini_t, "client", "port", 2);
    EXPECT_EQ((void*)NULL, ret_ptr);

    /* Clear the test data for this case */
    ret = pf_ini_clear(ini_t);
    EXPECT_EQ(0, ret);

}

#ifndef VALGRIND_CHECK /* Death test core dump makes valgrind too many errors */
TEST_F(PfIniTest, IniDeathTest)
{
    ::testing::FLAGS_gtest_death_test_style = "threadsafe"; /* avoid death warning */

    /* Define the local variables */
    int ret = -1;
    const char* ret_ptr = NULL;
    int32_t count = 0;
    pf_ini_t* ini_t = NULL;

    /* initilize test data for this case */
    EXPECT_DEBUG_DEATH((ini_t = pf_ini_load(NULL)), "");

    ini_t = pf_ini_load("/tmp/wyacyoabwwerrwer.ini");
    EXPECT_EQ((void*)NULL, ini_t);

    ini_t = pf_ini_load(ini_file);
    EXPECT_NE((void*)NULL, ini_t);

    /* Call your function for test */
    /* Check the result */
    EXPECT_DEBUG_DEATH((ret_ptr = pf_ini_find(NULL, "client", "port", 0)), "");
    EXPECT_DEBUG_DEATH((ret_ptr = pf_ini_find(ini_t, NULL, "port", 0)), "");
    EXPECT_DEBUG_DEATH((ret_ptr = pf_ini_find(ini_t, "client", NULL, 0)), "");

    EXPECT_DEBUG_DEATH((ret_ptr = pf_ini_find(ini_t, "client", "port",  -1)), "");

    EXPECT_DEBUG_DEATH((count = pf_ini_count(NULL, "client", "port")), "");
    EXPECT_DEBUG_DEATH((count = pf_ini_count(ini_t, NULL, "port")), "");
    EXPECT_DEBUG_DEATH((count = pf_ini_count(ini_t, "client", NULL)), "");

    count = pf_ini_count(ini_t, "client", "non_key");
    EXPECT_EQ(0, count);

    /* Clear the test data for this case */
    EXPECT_DEBUG_DEATH((ret = pf_ini_clear(NULL)), "");

    ret = pf_ini_clear(ini_t);
    EXPECT_EQ(0, ret);

}
#endif /* #ifndef VALGRIND_CHECK */

TEST_F(PfIniTest, IniExceptTest1)
{

    /* Define the local variables */
    pf_ini_t* ini_t = NULL;

    /* initilize test data for this case */
    ini_t = pf_ini_load(except_ini_file_1);
    EXPECT_EQ((void*)NULL, ini_t);

    /* Call your function for test */
    /* Check the result */
}

TEST_F(PfIniTest, IniExceptTest2)
{

    /* Define the local variables */
    pf_ini_t* ini_t = NULL;

    /* initilize test data for this case */
    ini_t = pf_ini_load(except_ini_file_2);
    EXPECT_EQ((void*)NULL, ini_t);

    /* Call your function for test */
    /* Check the result */
}

TEST_F(PfIniTest, IniExceptTest3)
{

    /* Define the local variables */
    pf_ini_t* ini_t = NULL;

    /* initilize test data for this case */
    ini_t = pf_ini_load(except_ini_file_3);
    EXPECT_EQ((void*)NULL, ini_t);

    /* Call your function for test */
    /* Check the result */
}

TEST_F(PfIniTest, IniExceptTest4)
{

    /* Define the local variables */
    pf_ini_t* ini_t = NULL;

    /* initilize test data for this case */
    ini_t = pf_ini_load(except_ini_file_4);
    EXPECT_EQ((void*)NULL, ini_t);

    /* Call your function for test */
    /* Check the result */
}
